package com.nononsenseapps.feeder.processor.interceptor

import com.nononsenseapps.feeder.db.entity.FeedItem
import com.nononsenseapps.feeder.processor.Interceptor

class RuleInterceptor :Interceptor{

    override fun intercept(chain: Interceptor.Chain): FeedItem {
        val feedItem=chain.getFeedItem()
        val feed=chain.getFeed()
        val processContext=chain.getProcessContext()
        processContext.modifyFlag=chain.getRuleManager().itemRuleCheck(feedItem)||processContext.modifyFlag
        return chain.proceed(feed, feedItem)
    }

}